<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>

<body>
     <div id="app">
       <input type="text" v-model.number="num1">
       <input type="text" v-model.number="num2">
       <button @click="sum">求和</button>
       <p>结果 <span>{{result}}</span></p>
     </div>
     <script>
        Vue.createApp({
          date(){
            return{
                 num1:0,
                 num2:0,
                 result:0
            }
          },
          methoods:{
            sum(){
                this.result=this.num1+this.num2
            }
          }
        }).mount("#app")


     </script>
</body>
</html>